package mxmf.enums;

public enum ContentTypeEnum {
	channel("channel", "频道"),
	movie("movie", "单剧集"),
	series("series", "连续剧"),
	episode("episode", "连续剧子集"),
	series2("series2", "系列剧"),
	episode2("episode2", "系列剧子集"),
	subject("subject", "专题"),
	link("link", "链接"),
	imagetxt("imagetxt", "图文"),
	column("column","专栏");

	  private final String code;
	
	  private final String name;
	
	  private ContentTypeEnum(String code, String name) {
	    this.code = code;
	    this.name = name;
	  }
	
	  public String getname() {
	    return name;
	  }
	
	  public String getCode() {
	    return this.code;
	  }
	 
	  public static String getNameByCode(String code) {
	      for(ContentTypeEnum typeEnum:ContentTypeEnum.values()) {
	          if(typeEnum.getCode().equals(code)) {
	              return typeEnum.getname();
	          }
	      }
	      return null;
	  }
	  
}
